import store from "@/store";
//为什么在vue自定义指令外获取不到
export default function (Vue) {
  console.log("button", store.state.user.buttons);
  Vue.directive("myshow", {
    // bind: function () {
    //   console.log("button", store.state.user.buttons);
    // },
    inserted: function (el, binding) {
      const myButtons = store.getters.buttons;
      console.log(myButtons);
      console.log(binding.value);

      if (!myButtons.includes(binding.value)) {
        el.remove();
      }
    },
  });
}
